const app = getApp()
Component({
  data: {
    num: '',
    selected: 0,
    color: "#989898",
    selectedColor: "#FF2D54",
    list: [{
      pagePath: "/index/index",
      iconPath: "/image/home.png",
      selectedIconPath: "/image/home1.png",
      text: "首页"
    }, {
      pagePath: "/index/index2",
      iconPath: "/image/menu.png",
      selectedIconPath: "/image/menu1.png",
      text: "商城"
    }, {
      pagePath: "/index/index3",
      iconPath: "/image/promotion.png",
      selectedIconPath: "/image/promotion1.png",
      text: "购物车"
    }, {
      pagePath: "/index/index4",
      iconPath: "/image/my.png",
      selectedIconPath: "/image/my1.png",
      text: "我的"
    }]
  },
  attached() {

  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({
        url
      })
      this.setData({
        selected: data.index
      })
    },
  }
})